<?php
// @filesource index.php
// 测试 排行榜
include_once 'peck.php';
include_once '_functions/spl_autoload.func.php';
include_once '_functions/global.func.php';

$rank['上周富豪排行'] = _all('CALL `kkyoo_rank`.`ext_showKRank`(\'k_rank\', \'0,3\', \'his_week\')');
$rank['上周礼金排行'] = _all('CALL `kkyoo_rank`.`ext_showKRank`(\'gift_rank\', \'0,3\', \'his_week\')');
$rank['上周人气排行'] = _all('CALL `kkyoo_rank`.`ext_showVoteRank`(\'voteTop\', \'0,3\', \'upperWeek\')');
$rank['上周K宝消费排行'] = _all('call `kkyoo_dynamicgift`.`b_showCashPayRank`(NULL, \'0,3\', \'his_week\');');
$rank['上周K宝礼金排行'] = _all('call `kkyoo_dynamicgift`.`b_showDyGiftRank`(NULL, \'0,3\', \'his_week\');');


$sql = 'SELECT * from kkyoo_rank.config_user_prefix where goods_id > 0 ;';
$c = _all($sql);
foreach($c as $v){
	$rank['<span style="color:blue">本周</span>：'.$v['desc']] = _all('CALL `kkyoo_dynamicgift`.`b_showDyGiftRank`(\''.$v['goods_id'].'\', \'0,10\', \'week\')');
	$rank['上周：'.$v['desc']] = _all('CALL `kkyoo_dynamicgift`.`b_showDyGiftRank`(\''.$v['goods_id'].'\', \'0,10\', \'his_week\')');
}


header('Content-Type:text/html;charset=UTF-8');
foreach($rank as $k=>$v){
	//$k2 = iconv('UTF-8', 'GB2312//IGNORE', $k);
	//$rank[$k2] = $v;
 	//unset($rank[$k]);
 	$e = var_export($v, TRUE);
 	echo '<hr/><h4>',$k,'</h4>',nl2br($e);
}



?>